how to sort an array of strings in javascript